package com.itheima.Controller;

import com.itheima.Service.MemberService;
import com.itheima.common.constant.MessageConstant;
import com.itheima.common.entity.Result;
import com.itheima.pojo.Login;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class MemberController {
    @Autowired
    private MemberService memberService;
    /**
     * 用户登录
     */
    @PostMapping ("/member/login")
    public Result login(@RequestBody Login login){
        log.info("用户登录:{}",login);
        memberService.login(login);
        return new Result(true, MessageConstant.LOGIN_SUCCESS,true);

    }
}
